package com.lottery.service.pc28.lobbyService.impl;

import com.lottery.dao.pc28.lobbyDao.PlaywayinfoDao;
import com.lottery.dto.ResultDto;
import com.lottery.entity.Playwayinfo;
import com.lottery.service.pc28.lobbyService.PlaywayinfoService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.Map;

@Service
public class PlaywayinfoServiceImpl implements PlaywayinfoService {

	private final Logger logger = LoggerFactory.getLogger(this.getClass());

	@Resource
	private PlaywayinfoDao playwayinfoDao;

	/**
	 * 通过playwayName查询一条数据
	 */
	@Override
	public ResultDto<Playwayinfo> selectPlaywayinfoByName(Map<String, Object> params) {
		// TODO Auto-generated method stub
		logger.info("bettinginfo的信息={}", params);
		ResultDto<Playwayinfo> result = new ResultDto<Playwayinfo>();
		try {
			Playwayinfo playwayinfo = playwayinfoDao.selectPlaywayinfoByName(params);
			result.setSuccess(true);
			result.setMessage("查询成功！");
			result.setData(playwayinfo);
		} catch (Exception e) {
			// TODO: handle exception
			result.setSuccess(false);
			result.setMessage("查询失败！");
		}

		logger.info("result的信息={}", result);
		return result;

	}

}
